<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_inquiry_normal.*" %>
<%@page import="com.lmpop.trade.ti_re_inquiry_normal.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.trade.ti_re_quote.*" %>
<jsp:useBean id="bean" class="com.lmpop.frame.util.RandomID" scope="page" /> 
<html>
  <head>
    
    <title>查看/回复供应询价</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="inquiry.js"></script>
	<script type="text/javascript" src="/program/admin/js/judgment.js" charset="UTF-8"></script>
</head>

<body>

  <% 
  String re_trade_id = bean.GenTradeId ();
  String s_user_id="";
	if( session.getAttribute("session_user_id") != null )
	{
		s_user_id = session.getAttribute("session_user_id").toString();
		
	}
  	String trade_id="";
  	if(request.getParameter("trade_id")!=null) trade_id = request.getParameter("trade_id");
  	Ti_inquiry_normalInfo ti_inquiry_normalInfo = new Ti_inquiry_normalInfo();
  	List list = ti_inquiry_normalInfo.getListByPk(trade_id);
	
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String info_id="",title="",order_num="",req_price="",content="",req_date="",req_file="",re_name="",req_compname="",req_email="",req_phone="",cust_id="",in_date="",user_id="",remark="";
  	if(map.get("info_id")!=null) info_id = map.get("info_id").toString();
  	if(map.get("title")!=null) title = map.get("title").toString();
  	if(map.get("order_num")!=null) order_num = map.get("order_num").toString();
  	if(map.get("req_price")!=null) req_price = map.get("req_price").toString();
  	if(map.get("content")!=null) content = map.get("content").toString();
  	if(map.get("req_date")!=null) req_date = map.get("req_date").toString();
  	if(map.get("req_file")!=null) req_file = map.get("req_file").toString();
  	if(map.get("re_name")!=null) re_name = map.get("re_name").toString();
  	if(map.get("req_compname")!=null) req_compname = map.get("req_compname").toString();
  	if(map.get("req_email")!=null) req_email = map.get("req_email").toString();
  	if(map.get("req_phone")!=null) req_phone = map.get("req_phone").toString();
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
  	if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
  	if(map.get("remark")!=null) remark = map.get("remark").toString();
	String goods_name="";
	if(map.get("goods_name")!=null) goods_name = map.get("goods_name").toString();

	Ti_re_inquiry_normalInfo ti_re_inquiry_normalInfo = new Ti_re_inquiry_normalInfo();
  	List relist = ti_re_inquiry_normalInfo.getListByPk(trade_id);
	Hashtable remap = new Hashtable();
  	if(relist!=null && relist.size()>0) remap = (Hashtable)relist.get(0);
  	String retrade_id="",retitle="",recontent="";
  	if(remap.get("trade_id")!=null) retrade_id = remap.get("trade_id").toString();
  	if(remap.get("title")!=null) retitle = remap.get("title").toString();
  	if(remap.get("content")!=null) recontent= remap.get("content").toString();

  %>
	 
	<h1>查看/回复供应询价</h1>
	
	<!--
	<table width="100%" align="center" cellpadding="0" cellspacing="0" class="dl_so">
        <tr>
          <td width="9%" align="center"><img src="/program/admin/index/images/ban_01.gif" /></td>
          <td width="91%" align="left">
		  <h4>-----------------</h4>
		  <span>1----------------。</span><br/>
		  <span>2----------------。</span>
		  </td>
        </tr>
      </table>
      <br/>
	  -->
	
	
	
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		<tr>
			<td align="right" width="15%">
				产品名称：
			</td>
			<td><%=goods_name%></td>
			<td align="right" width="15%">
				咨询标题：
			</td>
			<td><%=title%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				所报价格：
			</td>
			<td><%=req_price%></td>
			<td align="right" width="10%">
				期望回复时间：
			</td>
			<td><%=req_date%></td>
		</tr>
		<tr>
			<td align="right" width="15%">
				产品总量：
			</td>
			<td><%=order_num %></td>
			<td align="right" width="10%">
				咨询时间：
			</td>
			<td><%=in_date%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
			咨询人：
			</td>
			<td><%=re_name %></td>
			<td align="right" width="10%">
				询价企业：
			</td>
			<td><%=req_compname %></td>
		</tr>
	
	<tr>
			<td align="right" width="10%">
				Email：
			</td>
			<td><%=req_email %></td>
			<td align="right" width="10%">
				联系手机：
			</td>
			<td><%=req_phone %></td>
		</tr>
		<tr>
			<td align="right" width="10%">
				详细内容：
			</td>
			<td colspan="3"><%=content %></td>
		</tr>
		
	<tr>
			<td align="right" width="10%">
				备注：
			</td>
			<td colspan="3"><%=remark%></td>
		</tr>
		
	</table>
	
	<%
	if(relist!=null&&relist.size()!=0){	
	%>
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="15%">
				回复标题：
			</td>
			<td><%=retitle%></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				回复内容：
			</td>
			<td><%=recontent%></td>
		</tr>				
	</table>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	<%}
	else {
	%>
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	<input name="trade_id" id="trade_id" value="<%=trade_id%>" type="hidden" />
	<input name="re_trade_id" id="re_trade_id" value="<%=re_trade_id%>" type="hidden" />
	<input name="cust_id" id="cust_id" value="<%=cust_id%>" type="hidden" />
	<input name="user_id" id="user_id" value="<%=s_user_id%>"type="hidden" />
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		<tr>
			<td align="right" width="12%">
		     回复标题<font color="red">*</font>
			</td>
			<td><input name="title" id="title" type="text" size="50" maxlength="50" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this) " /></td>
		</tr>
		<tr>
			<td align="right" width="12%">
				回复内容<font color="red">*</font>
			</td>
			<td><textarea name="content" cols="56" rows="8" id="content" type="text" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this) " /></textarea></td>
		</tr>
		<tr>
			<td align="right" width="12%">
				备注：
			</td>
			<td><input name="remark" id="remark" type="text" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this) " /></td>
		</tr>
		
	</table>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="6451" />
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="return subform()" />&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
	<%}%>
	
	
</body>

</html>
